<?php
/**
 * The loop that displays a single post.
 *
 * The loop displays the posts and the post content.  See
 * http://codex.wordpress.org/The_Loop to understand it and
 * http://codex.wordpress.org/Template_Tags to understand
 * the tags used in it.
 *
 * This can be overridden in child themes with loop-single.php.
 *
 * @package WordPress
 * @subpackage Twenty_Ten
 * @since Twenty Ten 1.2
 */
?>

<?php if (have_posts()) :?><h1>This is Books List</h1> <br />	<?php
	index_pages_links();
    ?><br />
<table border="5" cellpadding="5" cellspacing="15" width="99%" cols="6" id="booklist" class="booklist">
<tr border="1" id="booklist" class="booklist"><th><h3>Book ID:</h3></th><th width="300px" style="width:400px;"><h3>Title:</h3></th><th><h3>Authors</h3></th><th><h3>Category/Class</h3></th><th><h3>Publishers</h3></th><th><h3>Availablity</h3></th></tr>

<?php while (have_posts()) : the_post(); 		
		$custom = get_post_custom($post->ID);
		$thumb = $custom['book-thumb'][0];
		$bookid= $custom['bookid'][0];
		$authors= $custom['bookauthors'][0];
		$availablity= $custom['wpbl_availablity'][0];
		?>

<tr><td><a href="<?php the_permalink() ?>" title="<?php printf(__("Permanent Link to %s", "wpbl"), the_title_attribute('echo=0')); ?>"><?php echo $bookid; ?></a></td>
<td style="width:400px;"><a href="<?php the_permalink() ?>" title="<?php printf(__("Permanent Link to %s", "wpbl"), the_title_attribute('echo=0')); ?>"><?php the_title(); ?></a></td>
<td><?php the_terms( $post->ID, 'authors'); ?></td>
<td><?php the_terms( $post->ID, 'classcat'); ?></td>
<td><?php the_terms( $post->ID, 'publishers'); ?></td>
<td class="<?php echo $availablity; ?>"><?php echo $availablity; ?></td>
</tr>
 
<?php endwhile; ?></table><br /><?php else: ?>

<div class="entry">
<p><?php _e('Sorry, no posts matched your criteria.','wpbl'); ?></p>
</div>

<?php endif; ?>
